package com.filter;

import com.entity.Poker;
import com.mike.median.util.PokerUtil;

import java.util.List;
import java.util.Map;

/**
 * 同一牌型过滤
 * 花色全相同的牌新过滤
 */
public class SameTypeGroupFilter extends BaseGroupFilter {
    public SameTypeGroupFilter(List<Poker> pokers) {
        super(pokers);
    }

    @Override
    protected boolean filterHandler() {
        Map<Poker.TYPE_ENUM, Integer> grouTypeMap = PokerUtil.groupType(pokers);
        if (grouTypeMap.size() == 1) {
            return true;
        }
        return false;
    }
}
